﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../source/layui-v2.5.6/css/layui.css">
    <link rel="stylesheet" href="../source/css/primary.css">
    <script src="../source/js/common_url.js"></script>
    <script src="../source/js/util.js"></script>
    <script src="../nurse_mgr/js/common_data.js"></script>
    <script src="../source/js/jquery-1.9.1.min.js"></script>
    <script src="../source/layer/layer.js"></script>
    <script src="../source/layui-v2.5.6/layui.all.js"></script>
    <style type="text/css">
        .body_content{
            padding: 15px 30px;
        }
        .layui-form-item{
            text-align: center;
        }
        .layui-form-item,
        .layui-input{
            line-height: 32px;
            height: 32px;
        }
        .layui-form-label{
            padding: 6px 15px 6px 0;
        }
        .layui-form-item .layui-input-inline{
            margin:0;
            display: inline-block;
        }
        .layui-form-item .layui-input-inline .layui-input{
            width: 160px;
        }
        .layui-form-radio{
            margin: 0;
        }
    </style>
</head>
<body>
<div class="body">
    <div class="body_content layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">延时时长:</label>
            <div class="layui-input-inline"><input type="text" id="delayTime" class="layui-input"></div>
            <span>min(<=180)</span>
        </div>
        <div class="layui-form-item">
            <input type="radio" lay-filter="timer" name="timer" value="15" title="15m">
            <input type="radio" lay-filter="timer" name="timer" value="30" title="30m">
            <input type="radio" lay-filter="timer" name="timer" value="45" title="45m">
            <input type="radio" lay-filter="timer" name="timer" value="60" title="60m">
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        layui.use('form', function(){
            var form = layui.form;
            form.render().on('radio(timer)', function(data){
                $('#delayTime').val(data.value)
            });
        });
    });
    // 确定做延时操作
    function confirmDelay(callback) {
        var num = $('#delayTime').val();
        if (num == "") return callback && callback({status:10086,desc:'请选择或输入延时时长'});
        if (!(/(^[1-9]\d*$)/.test(num)) || num > 180)  return callback && callback({status:10086,desc:'请输入小于180的正整数'});
        var id = GetQueryString("id");
        var loginId = GetQueryString("loginId");
        var queueKey = GetQueryString("queueKey");
        var hospitalId = GetQueryString("hospitalId");
        // 调用延时方法
        $.ajax({
            url: _delayPatients,
            type: "post",
            data: {
                id: id,
                delayTime: num,
                queueKey: queueKey,
                loginId: loginId,
                hospitalId: hospitalId
            },
            success: function (data) {
                var result = JSON.parse(data);
                callback && callback(result)
            },
            error: function (jqXHR, textStatus, errorThrown) {
                layer.msg("操作失败!", {icon: 2});
            }
        });
    }
</script>
</body>

</html>
